package com.molihub.service;

import com.molihub.entity.ArticleLike;
import com.molihub.entity.User;

import java.util.List;

/**
 * @ClassName: ArticleLikeService
 * @Description: 处理文章点赞的业务层
 * @author: GGBOY
 * @date 2020/2/12 16:07
 * @Version: 1.0
 **/
public interface ArticleLikeService {

    /**
     * 添加一条用户对文章的点赞记录
     *
     * @param articleLike 点赞记录
     * @return java.lang.Integer
     * @author GGBOY
     * @date 2020/2/12
     */
    public Integer addLikeRecord(ArticleLike articleLike);

    /**
     * 根据文章ID查找给这篇文章点过赞的用户
     *
     * @param articleId 文章ID
     * @return java.util.List<com.molihub.entity.User> 点过赞的用户集合
     * @author GGBOY
     * @date 2020/2/12
     */
    public List<User> findLikeUsersByArticleId(Integer articleId);


    /**
     * 根据文章ID和用户ID查找对应的点赞记录
     *
     * @param userId    用户ID
     * @param articleId 文章ID
     * @return java.lang.Integer
     * @author GGBOY
     * @date 2020/2/23
     */
    public Integer getLikeRecordByUserAndArticleId(Integer userId, Integer articleId);

    /**
     * 根据文章ID和用户ID删除对应的点赞记录
     *
     * @param userId    用户ID
     * @param articleId 文章ID
     * @return void
     * @author GGBOY
     * @date 2020/2/23
     */
    public void deleteRecordByUserAndArticleId(Integer userId, Integer articleId);
}
